class Object
  
  def random_name(length=(rand(10)+1))
    Array.new(length){("a".."z").to_a.sort_by{rand}[0]}.join("");
  end
  
  def local_variable_get(var, bind)
    eval(var, bind);
  end
  
  def local_variable_set(var, value, bind)
    locals = eval("local_variables", bind);
    begin 
      tmp_var_name = random_name;
    end while locals.include?(tmp_var_name);
    p tmp_var_name
    eval("lambda{|#{tmp_var_name}| #{var} = #{tmp_var_name};}", bind).call(value);
  end

end

car = "ka"
local_variables.each do |var|
  local_variable_set var, Object.new, binding;
  p var
  p local_variable_get(var, binding)
end